package meng.spring.test1.ioc;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;

/**
 * @describe: 类描述信息
 * @author: morningcat.zhang
 * @date: 2019/2/8 3:56 PM
 */
public class Test3 {

    public static void main(String[] args) {
        ClassPathResource res = new ClassPathResource("spring-ioc.xml");
        DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
        reader.loadBeanDefinitions(res);


        OneInterface o = factory.getBean("oneInterface", OneInterface.class);
        o.say("BeanFactory");
    }
}
